﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="LuminousFlux.cs" company="QuantityTypes">
//   Copyright (c) 2014 QuantityTypes contributors
// </copyright>
// <summary>
//   Implements operators related to luminous flux.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace QuantityTypes
{
    /// <summary>
    ///     Implements operators related to luminous flux.
    /// </summary>
    public partial struct LuminousFlux
    {
        /// <summary>
        ///     Implements the operator /.
        ///     E=Φ/A
        /// </summary>
        /// <param name="l1"> The illuminance. </param>
        /// <param name="l2"> The area. </param>
        /// <returns>  Illuminance generated by a luminous flux flowing through a given plane. </returns>
        public static Illuminance operator /(LuminousFlux l1, Area l2)
        {
            return new Illuminance(l1.value / l2.Value);
        }

        /// <summary>
        ///     Implements the operator /.
        ///     E=Φ/r²
        ///     Just works for Isocandela sources
        /// </summary>
        /// <param name="l1"> The illuminance. </param>
        /// <param name="l2"> The length. </param>
        /// <returns> The Illuminance generated by an isocandela source in a given distance. </returns>
        public static Illuminance operator /(LuminousFlux l1, Length l2)
        {
            return l1/ l2.Squared();
        }
    }
}